<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>小程序配置生成</title>
	<link rel="stylesheet" type="text/css" href="./css/index.css">
</head>
<body>
	<header id="header" class="">
		<nav>
			微信小程序页面JSON生成器(直接复制右侧JSON预览到你的小程序JSON配置文件即可)
		</nav>
	</header><!-- /header -->
	<div id="config">
			<div class="config-title">设置小程序中所有页面的地址(小程序中所有页面的删减/增加都要在该项设置对应的地址)</div>
				<ul>
					<li>
						<label>设置页面地址路径(默认地址pages/已帮你设置好，你只需添加你自定义的文件夹名称和该文件夹下的主文件名称即可，如:foldername/filename)</label>
						<ul class="runroute">
							<li>
								<span>index/index</span>
								<button onclick="removeroute(this)" type="button" name="removeroute" style="padding:3px 5px;">删除</button>
							</li>
							<li>
								<span>logs/logs</span>
								<button onclick="removeroute(this)" type="button" name="removeroute" style="padding:3px 5px;">删除</button>
							</li>
						</ul>
						<label>
							<input type="text" onblur="addroute(this.value)" id="route" name="backgroundcolor">
						</label>
					</li>
				</ul>
			<div class="config-title">设置默认页面的窗口表现(用于设置小程序的状态栏、导航条、标题、窗口背景色。)</div>
				<ul>
					<li>
						<label>导航栏(header)背景颜色,如"#000000"</label>
						<input type="text" onblur="struc.addwindow(this.dataset.name,this.value)" data-name="navigationBarBackgroundColor">
					</li>
					<li>
						<label>导航栏(header)标题颜色,仅支持 black/white</label>
						<label>
							<input data-name="navigationBarTextStyle" onclick="struc.addwindow(this.dataset.name,this.value)" name="navigationBarTextStyle" type="radio" value="black" /><span>black</span>
						</label>
						<label>
							<input data-name="navigationBarTextStyle" onclick="struc.addwindow(this.dataset.name,this.value)" name="navigationBarTextStyle" type="radio" value="white" /><span>white</span>
						</label>
					</li>
					<li>
						<label>导航栏(header)标题文字内容</label>
						<input type="text" data-name="navigationBarTitleText" onblur="struc.addwindow(this.dataset.name,this.value)">
					</li>
					<li>
						<label>页面(body)窗口的背景色,如"#000000"</label>
						<input type="text" data-name="backgroundColor" onblur="struc.addwindow(this.dataset.name,this.value)">
					</li>
					<li>
						<label>是否开启下拉刷新，详见<a target="view_window" href="https://mp.weixin.qq.com/debug/wxadoc/dev/framework/app-service/page.html?t=1475218868741#页面相关事件处理函数">页面相关事件处理函数</a></label>
						<label>
							<input data-name="enablePullDownRefresh" name="enablePullDownRefresh" type="radio" onclick="struc.addwindow(this.dataset.name,this.value)" value="true" />
							<span>开启</span>
						</label>
						<label>
							<input data-name="enablePullDownRefresh" name="enablePullDownRefresh" type="radio" onclick="struc.addwindow(this.dataset.name,this.value)" value="false" />
							<span>关闭</span> 
						</label>
					</li>
					<li>
						<label>设置下拉刷新背景字体、loading 图的样式，仅支持 dark/light</label>
						<label>
							<input data-name="backgroundTextStyle" name="backgroundTextStyle" type="radio" onclick="struc.addwindow(this.dataset.name,this.value)" value="dark" /><span>dark</span> 
						</label>
						<label>
							<input data-name="backgroundTextStyle" name="backgroundTextStyle" type="radio" onclick="struc.addwindow(this.dataset.name,this.value)" value="light" /><span>light</span> 
						</label>
					</li>
				</ul>
			<div class="config-title">设置底部tab的表现(底部按钮最少2个，最多5个，在列表中设置按钮路径和文字)</div>
				<ul>
					<li>
						<label>底部(footer)tab上的文字默认颜色,如"#000000"</label>
						<input type="text" data-name="color" onblur="struc.addtabBar(this.dataset.name,this.value)">
					</li>
					<li>
						<label>底部(footer)tab上的文字选中时的颜色,如"#000000"</label>
						<input type="text" data-name="selectedColor" onblur="struc.addtabBar(this.dataset.name,this.value)">
					</li>
					<li>
						<label>底部(footer)tab的背景色,如"#000000"</label>
						<input type="text" data-name="backgroundColor" onblur="struc.addtabBar(this.dataset.name,this.value)">
					</li>
					<li>
						<label>底部(footer)tabbar上边框的颜色，仅支持 black/white</label>
						<label>
							<input name="borderStyle" data-name="borderStyle" type="radio" value="black" onclick="struc.addtabBar(this.dataset.name,this.value)"/>
							<span>black</span> 
						</label>
						<label>
							<input name="borderStyle"  data-name="borderStyle" type="radio" value="white" onclick="struc.addtabBar(this.dataset.name,this.value)"/>
							<span>white</span>
						</label>
					</li>
					<li>
						<label>底部(footer)tab的按钮列表（最少2个、最多5个tab，默认地址pages/已帮你设置好）</label>
						<ul class="runtabBar">
							<li>
								<label>Text:<span>首页</span>&nbsp;&nbsp;&nbsp;&nbsp;URL:<span>index/index</span>&nbsp;&nbsp;&nbsp;&nbsp;<button onclick="removetabBar(this)" type="button" name="removeroute" style="padding:3px 5px;">删除</button>
								</label>
							</li>
							<li>
								<label>Text:<span>日志</span>&nbsp;&nbsp;&nbsp;&nbsp;URL:<span>logs/logs</span>&nbsp;&nbsp;&nbsp;&nbsp;<button onclick="removetabBar(this)" type="button" name="removeroute" style="padding:3px 5px;">删除</button>
								</label>
							</li>
						</ul>
						<label>
							<input type="text" onblur="addtabBar(this.value)" id="route" name="backgroundcolor">
						</label>
					</li>
				</ul>
			<div class="config-title">设置网络超时时间(强烈建议设置该项，否则请求超时时无法响应并给出信息反馈)</div>
				<ul>
					<li>
						<label><a target="view_window" href="https://mp.weixin.qq.com/debug/wxadoc/dev/api/network-request.html?t=1475218868741">wx.request</a>的超时时间，单位毫秒,如"100000"</label>
						<input type="number" data-name="wx.request" onblur="struc.addnetworkTimeout(this.dataset.name,this.value)">
					</li>
					<li>
						<label><a target="view_window" href="https://mp.weixin.qq.com/debug/wxadoc/dev/api/network-socket.html?t=1475218868741">wx.connectSocket</a>的超时时间，单位毫秒,如"100000"</label>
						<input data-name="wx.connectSocket" onblur="struc.addnetworkTimeout(this.dataset.name,this.value)" type="number">
					</li>
					<li>
						<label><a target="view_window" href="https://mp.weixin.qq.com/debug/wxadoc/dev/api/network-file.html?t=1475218868741#wxuploadfileobject">wx.uploadFile</a>的超时时间，单位毫秒,如"100000"</label>
						<input type="number" data-name="wx.uploadFile" onblur="struc.addnetworkTimeout(this.dataset.name,this.value)">
					</li>
					<li>
						<label><a target="view_window" href="https://mp.weixin.qq.com/debug/wxadoc/dev/api/network-file.html?t=1475218868741#wxdownloadfileobject">wx.downloadFile</a>的超时时间，单位毫秒,如"100000"</label>
						<input type="number" data-name="wx.downloadFile" onblur="struc.addnetworkTimeout(this.dataset.name,this.value)">
					</li>
				</ul>
			<div class="config-title">设置是否开启debug模式(非必须，可不设置，默认为true)</div>
				<ul>
					<li>
						<label>可以在开发者工具中开启 debug 模式</label>
						<label>
							<input onclick="struc.configdebug(true);" name="debug" type="radio" value="" />
							<span>开启</span> 
						</label>
						<label>
							<input onclick="struc.configdebug(false);" name="debug" type="radio" value="" />
							<span>关闭</span>
						</label>
					</li>
				</ul>
	</div>
	<content id="code">
		<div class="code-header">
			JSON配置文件预览
		</div>
		<div class="code-body" readonly>
			
		</div>
	</content>
	<script type="text/javascript" src="./js/index.js"></script>
</body>
</html>